<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" >

<%@ include file="../base/taglibs.jsp" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>

<%@ page session="true" %>

<html>
	<%@ include file="../base/head.jsp" %>

	<body>
		<div id="wrap">
			<%@ include file="../snipped/header.jsp"%>
			
			<div id="content">
				
				<c:if test="${login}">
					
					<form:form id="form" method="post" modelAttribute="userLoginFormBean" action="loginSubmit">
					
						<h2>Přihlášení</h2>
						<%@ include file="../snipped/msgErr.jsp" %>
						
						<fieldset>
							<legend><b>Povinné položky</b></legend>
							<table>
								<tr>
									<td><form:label path="nick">Nick:</form:label></td>
									<td><form:input path="nick" /></td>
								</tr>
								<tr>
									<td><form:label path="password">Heslo:</form:label></td>
									<td><form:password path="password" /></td>
								</tr>
							</table>
						</fieldset>
						<p><button type="submit">Přihlásit</button></p>
					</form:form>
				</c:if>
				
				<c:if test="${not login}">
					
					<form:form id="form" method="post" modelAttribute="userRegistrFormBean" action="registrSubmit">
						<h2>Registrace</h2>
						<%@ include file="../snipped/msgErr.jsp" %>
						
						<fieldset>
							<legend><b>Povinné položky</b></legend>
							<table>
								<tr>
									<td><form:label path="nick">Nick:</form:label></td>
									<td><form:input path="nick" /></td>
								</tr>
								<tr>
									<td><form:label path="password">Heslo:</form:label></td>
									<td><form:password path="password" /></td>
								</tr>
								<tr>
									<td><form:label path="password2">Heslo (pro ověření):</form:label></td>
									<td><form:password path="password2" /></td>
								</tr>
							</table>
						</fieldset>
						<br /><br />
						<fieldset>		
							<legend><b>Nepovinné položky</b></legend>		
							<table>			
								<tr>
									<td><form:label path="name">Jméno:</form:label></td>
									<td><form:input path="name" /></td>
								<tr>
								<tr>
									<td><form:label path="surname">Příjmení:</form:label></td>
									<td><form:input path="surname" /></td>
								</tr>
								<tr>
									<td><form:label path="email">Email:</form:label></td>
									<td><form:input path="email" /></td>
								</tr>
								<tr>
									<td><form:label path="sign" cssStyle="vertical-align:Top;">Podpis:</form:label></td>
									<td><form:textarea path="sign" cols="85"/></td>
								</tr>
							</table>
						</fieldset>
						<p><button type="submit">Registrovat</button></p>
					</form:form>
				</c:if>
				
			</div>
			
			<br />
			<%@ include file="../snipped/footer.jsp"%>
		</div>
	</body>
	
</html>